---
title: Time series feature derivation
description: A comprehensive reference of the DataRobot time series feature derivation process.
---

# Time series feature derivation {: #time-series-feature-derivation }


The following tables document the feature derivation process&mdash;operators used and feature names created&mdash;that create the time series modeling dataset. For additional information, see the descriptions of:

* [Intra-month seasonality detection](ts-feature-lists#intra-month-seasonality-detection)
* [Zero-inflated models](ts-feature-lists#zero-inflated-models)
* [Automatically created feature lists](ts-feature-lists#automatically-created-feature-lists)

## Process overview {: #process-overview }

When deriving new features, DataRobot passes each feature through zero or more preprocessors (some features are not preprocessed), then passes the result though one or more extractors, and then finally through postprocessors.

Preprocessors are only run&mdash;although this step can be skipped&mdash;for target, date, and text columns (no feature columns):

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataset --> preprocessor --> extractor --> postprocessor --> final

Feature columns move from input to extractor or postprocessor:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataset --> extractor --> postprocessor --> final

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataset --> extractor --> final


More detailed, DataRobot:

1. Applies [automatic feature transformation](auto-transform) on date features during EDA1. These features are excluded from the EDA2 feature derivation process described below; only the original undergoes the  process (i.e., transformed features are not further transformed).
2. Applies a preprocessor (e.g., CrossSeriesBinaryPreprocessor, NextEventType, Transform, and others).
3. Creates an "intermediate feature" for the target, date, or text features&mdash;a feature where preprocessing was applied but will not be complete until application of the post-processing operation. For example, `Sales (log)` is an intermediate step to the final `Sales (log) (diff) (14 day min)` and by itself is not a valid feature.
4. Uses an extractor step to consume the input from either the original dataset or the intermediate feature. The postprocessor (next step) consumes this output as input.
5. Applies postprocessing to the results of the extractor, creating the "final feature" to use for modeling.

See the [visual representation](#feature-reference) of feature generation for a quick reference.

### Feature reference {: #feature-reference }

The following provides a general overview of the derivation process.

A sample <span style="color:blue;">input dataset</span>:

| <span style="color:blue;">  Date </span>  |  <span style="color:blue;">Target </span> |
|----------|:---------:|
|  <span style="color:blue;">1/1/20 </span>  |        <span style="color:blue;">1 </span> |
| <span style="color:blue;">2/1/20 </span>   |        <span style="color:blue;">2 </span> |
| <span style="color:blue;">3/1/20  </span>  | <span style="color:blue;"> 3 </span> |

![](images/fear-1.png)

The resulting <span style="color:green;">time series modeling dataset</span>:

<span style="color:green;">

|<span style="color:green;"> Date (actual) </span> | <span style="color:green;">Target (actual) </span> |  <span style="color:green;">Forecast distance  </span>|
|----------------|:-----------------:|:--------------------:|
| <span style="color:green;"> 1/1/20 </span>       | <span style="color:green;"> 1 </span>| <span style="color:green;">                  1 </span>|
|  <span style="color:green;">2/1/20</span>        | <span style="color:green;"> 2 </span>|   <span style="color:green;">                1 </span>|
|  <span style="color:green;">3/1/20 </span>       | <span style="color:green;"> 3 </span>|   <span style="color:green;">                1 </span>|
| <span style="color:green;">1/1/20  </span>       | <span style="color:green;"> 1 </span>|  <span style="color:green;">                2 </span>|
| <span style="color:green;">2/1/20   </span>      | <span style="color:green;"> 2 </span>|  <span style="color:green;">                 2 </span>|
| <span style="color:green;"> 3/1/20  </span>      | <span style="color:green;"> 3 </span>|  <span style="color:green;">                2 </span>|


**Example of target-derived feature**

![](images/fear-2.png)

**Example of numeric feature**

![](images/fear-3.png)

**Example of categorical feature**

![](images/fear-4.png)

**Example of text feature**

![](images/fear-5.png)

**Example of date feature**

![](images/fear-6.png)

## Feature types {: #feature-types }

Feature derivation acts on features based on their type. The examples and explanations below use these variables (for example, `<target>`) to describe the interactions.

|  Component | Description |
|------------|-------------|
|  [<target> (intermediate)](#intermediate-features)<br />[<target> (final)](#final-features)      | The feature selected at project start as the feature to predict. |
| [<feature> (final)](#final-features) | Any feature or target column from the dataset that is not of type date or text. Processing is the same as that done to the target if the feature is numeric; if the feature is categorical, there are differences (noted in the tables below). DataRobot does not apply preprocessing to non-target features. |
| [<primary\_date> (intermediate)](#intermediate-features)<br />[<primary\_date> (final)](#final-features) | The primary date/time feature selected to enable time-aware modeling at project start. |
| [<date> (intermediate)](#intermediate-features)<br />[<date> (final)](#final-features)               | Any date feature, other than automatically transformed features during EDA1, that is not a primary date/time feature. |
| [<text> (intermediate)](#intermediate-features) | A text column. |

The tables include information on:

* Feature name patterns&mdash;the feature type followed by the pattern tag ("actual" if the feature is from the original uploaded dataset). This is the resulting feature name after all transformations are complete (for example: `<target> (diff)`).
*  Tags&mdash;characteristics of the feature.
*  Examples of the post-processed feature.

## Intermediate features {: #intermediate-features }

The sections below detail the intermediate features created for target, primary date, date, and text features.

=== "`<target>`"

	The sections below list each name pattern for target features.

	---

	<span style="color:red;font-size: 1rem"> `<target> (log)`</span>

	**Description:** A log-transformed target.

	**Project type:** Regression, multiplicative trend

	**Tags:**

	* Target-derived
	* Numeric
	* Multiplicative

	**Example(s):**

	```
		sales (log) (naive latest value)
		sales (log) (diff) (1st lag)
		sales (log) (7 day diff) (35 day max)
		sales (log) (1 month diff) (2nd lag)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (diff)`</span>

	**Description:** A diff-transformed target, created by calculating the difference between the current value and the previous single time step value. Time step is based on the interval in the uploaded dataset. Example: A quarterly dataset has a time step of 3 months.

	**Project type:** Regression, non-stationary

	**Tags:**

	* Target-derived
	* Numeric
	* Stationarity

	**Example(s):**

	```
	sales (diff) (1st lag)
	sales (diff) (7 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<period> diff)`</span>

	**Description:** A diff-transformed target, created by calculating the difference between the current value and the previous <period> value.

	**Project type:** Regression, seasonality

	**Tags:**

	* Target-derived
	* Numeric
	* Seasonal

	**Example(s):**

	```
	sales (7 day diff) (1st lag)
	sales (7 day diff) (14 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (1 month diff)`</span>

	**Description:** A diff-transformed target, created by calculating the difference between the current value and the previous month (same day of month) value.

	**Project type:** Regression, intramonth seasonality

	**Tags:**

	* Target-derived
	* Numeric
	* Seasonal

	**Example(s):**

	```
	sales (1 month diff) (35 day mean)
	sales (1 month diff) (1st lag)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (1 month match end diff)`</span>

	**Description:** A diff-transformed target, created by calculating the difference between the current value and the previous month (aligned to the end of the month) value.

	**Project type:** Regression, intramonth seasonality

	**Tags:**

	* Target-derived
	* Numeric
	* Seasonal

	**Example(s):**

	```
	sales (1 month match end diff) (2nd lag)
	sales (1 month match end diff) (35 day max)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (1 month match weekly diff)`</span>

	**Description:** A diff-transformed target, created by calculating the difference between the current value and the previous month (aligned to the week of the month and weekday) value.

	**Project type:** Regression, intramonth seasonality

	**Tags:**

	* Target-derived
	* Numeric
	* Seasonal

	**Example(s):**

	```
	sales (1 month match weekly diff) (3th lag)
	sales (1 month match weekly diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (1 month match weekly diff from end)`</span>

	**Description:** A diff-transformed target, created by calculating the difference between the current value and the previous month (aligned to the weekday and the "week of the month from the end of the month") value.

	**Project type:** Regression, intramonth seasonality

	**Tags:**

	* Target-derived
	* Numeric
	* Seasonal

	**Example(s):**

	```
	sales (1 month match weekly diff from end) (2nd lag)
	sales (1 month match weekly diff from end) (35 day min)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (total)`</span>

	**Description:** Total target, for the given time, across all series.

	**Project type:** Cross series regression, total aggregation

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series

	**Example(s):**

	```
	sales (total) (2nd lag)
	sales (total) (35 day mean)
	sales (total) (3rd lag) (diff 35 day mean)
	sales (total) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (weighted total)`</span>

	**Description:** Weighted total target, for the given time, across all series.

	**Project type:** Cross series regression, total aggregation, user-specified weights

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series
	* Weighted

	**Example(s):**

	```
	sales (weighted total) (2nd lag)
	sales (weighted total) (35 day mean)
	sales (weighted total) (3rd lag) (diff 35 day mean)
	sales (weighted total) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> total)`</span>

	**Description:** Total target, for the given time, across all series within the same user-specified group.

	**Project type:** Cross series regression, total aggregation, user-specified groupby feature

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series

	**Example(s):**

	```
	sales (region total) (2nd lag)
	sales (region total) (35 day mean)
	sales (region total) (3rd lag) (diff 35 day mean)
	sales (region total) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> weighted total)`</span>

	**Description:** Weighted total target, for the given time, across all series within the same user-specified group.

	**Project type:** Cross series regression, total aggregation, user-specified groupby feature, user-specified weights

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series
	* Weighted

	**Example(s):**

	```
	sales (region weighted total) (2nd lag)
	sales (region weighted total) (35 day mean)
	sales (region weighted total) (3rd lag) (diff 35 day mean)
	sales (region weighted total) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (average)`</span>

	**Description:** Target average, for the given time, across all series.

	**Project type:** Cross series regression, average aggregation

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series

	**Example(s):**

	```
	sales (average) (2nd lag)
	sales (average) (35 day mean)
	sales (average) (3rd lag) (diff 35 day mean)
	sales (average) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (weighted average)`</span>

	**Description:** Weighted target average, for the given time, across all series.

	**Project type:** Cross series regression, average aggregation, user-specified weights

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series
	* Weighted

	**Example(s):**

	```
	sales (weighted average) (2nd lag)
	sales (weighted average) (35 day mean)
	sales (weighted average) (3rd lag) (diff 35 day mean)
	sales (weighted average) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> average)`</span>

	**Description:** Target average, for the given time, across all series within the same group.

	**Project type:** Cross series regression, average aggregation, user-specified cross-series groupby feature

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series

	**Example(s):**

	```
	sales (region average) (2nd lag)
	sales (region average) (35 day mean)
	sales (region average) (3rd lag) (diff 35 day mean)
	sales (region average) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> weighted average)`</span>

	**Description:** Weighted target average, for the given time, across all series within the same group.

	**Project type:** Cross series regression, total aggregation, user-specified groupby feature and weights

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series
	* Weighted

	**Example(s):**

	```
	sales (region weighted average) (2nd lag)
	sales (region weighted average) (35 day mean)
	sales (region weighted average) (3rd lag) (diff 35 day mean)
	sales (region weighted average) (7 day diff) (35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (proportion)`</span>

	**Description:** Numeric target that specifies the proportion of the target across all series.

	**Project type:** Cross series regression, total aggregation, nonnegative target, sufficiently consistent series presence across timestamps

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series

	**Example(s):**

	```
	sales (proportion) (1st lag)
	sales (proportion) (14 day mean)
	sales (proportion) (30 day max) (diff 7 day mean)
	sales (proportion) (7 day diff) (1st lag)
	sales (proportion) (7 day diff) (30 day min)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (weighted proportion)`</span>

	**Description:** Numeric target that specifies the weighted proportion of the target across all series.

	**Project type:** Cross series regression, total aggregation, nonnegative target, sufficiently consistent series presence across timestamps, user-specified weights

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series
	* Weighted

	**Example(s):**

	```
	sales (weighted proportion) (1st lag)
	sales (weighted proportion) (14 day mean)
	sales (weighted proportion) (30 day max) (diff 7 day mean)
	sales (weighted proportion) (7 day diff) (1st lag)
	sales (weighted proportion) (7 day diff) (30 day min)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> proportion)`</span>

	**Description:** Numeric target that specifies the proportion of the target across all series within the same group.

	**Project type:** Cross series regression, total aggregation, nonnegative target, sufficiently consistent series presence across timestamps, user-specified cross-series groupby feature

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series

	**Example(s):**

	```
	sales (region proportion) (naive latest value)
	sales (region proportion) (2nd lag)
	sales (region proportion) (7 day mean)
	sales (region proportion) (1st lag) (diff 7 day mean)
	sales (region proportion) (7 day diff) (1st lag)
	sales (region proportion) (7 day diff) (30 day min)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> weighted proportion)`</span>

	**Description:** Numeric target that specifies the weighted proportion of the target across all series within the same group.

	**Project type:** Cross series regression, total aggregation, nonnegative target, sufficiently consistent series presence across timestamps, user-specified cross-series groupby feature and weights

	**Tags:**

	* Target-derived
	* Numeric
	* Cross series
	* Weighted

	**Example(s):**

	```
	sales (region weighted proportion) (naive latest value)
	sales (region weighted proportion) (2nd lag)
	sales (region weighted proportion) (7 day mean)
	sales (region weighted proportion) (1st lag) (diff 7 day mean)
	sales (region weighted proportion) (7 day diff) (1st lag)
	sales (region weighted proportion) (7 day diff) (30 day min)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (total equal <label>)`</span>

	**Description:** Total target that equals <label> boolean flag, for a given time, across all series.

	**Project type:** Cross-series classification, total aggregation

	**Tags:**

	* Target-derived
	* Binary
	* Cross series

	**Example(s):**

		`is_zero_sales (total equal 1) (1st lag)`

	---

	<span style="color:red;font-size: 1rem"> `<target> (weighted total equal <label>)`</span>

	**Description:** Weighted total target-equals-`<label>` boolean flag, for a given time, across all series.

	**Project type:** Cross-series classification, total aggregation, user-specified weights

	**Tags:**

	* Target-derived
	* Binary
	* Cross series
	* Weighted

	**Example(s):**

	```
	is_zero_sales (weighted total equal 1) (1st lag)
	is_zero_sales (weighted total equal 1) (1st lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> total equal <label>)`</span>

	**Description:** Total target-equals-`<label>` boolean flag, for a given time, across all series and within the same group.

	**Project type:** Cross-series classification, total aggregation, user-specified groupby feature

	**Tags:**

	* Target-derived
	* Binary
	* Cross series

	**Example(s):**

	```
	is_zero_sales (region total equal 1) (1st lag)
	is_zero_sales (region total equal 1) (1st lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> weighted total equal <label>)`</span>

	**Description:** Weighted total target-equals-`<label>` boolean flag, for a given time, across all series within the same group.

	**Project type:** Cross-series classification, total aggregation, user-specified cross-series groupby feature and weights

	**Tags:**

	* Target-derived
	* Binary
	* Cross series
	* Weighted

	**Example(s):**

	```
	is_zero_sales (region weighted total equal 1) (1st lag)
	is_zero_sales (region weighted total equal 1) (1st lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (fraction equal <label>)`</span>

	**Description:** Average target-equals-`<label>` (also called fraction) boolean flag, for a given time, across all series.

	**Project type:** Cross-series classification, average aggregation

	**Tags:**

	* Target-derived
	* Binary
	* Cross series

	**Example(s):**

	```
	is_zero_sales (fraction equal 1) (1st lag)
	is_zero_sales (fraction equal 1) (1st lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (weighted fraction equal <label>)`</span>

	**Description:** Weighted average target-equals-`<label>` (also called fraction) boolean flag, for a given time, across all series.

	**Project type:** Cross-series classification, average aggregation, user-specified weights

	**Tags:**

	* Target-derived
	* Binary
	* Cross series
	* Weighted

	**Example(s)**

	```
	is_zero_sales (weighted fraction equal 1) (3rd lag)
	is_zero_sales (weighted fraction equal 1) (3rd lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> fraction equal <label>)`</span>

	**Description:** Average target-equals-`<label>` (also called fraction) boolean flag, for a given time, across all series within the same group.

	**Project type:** Cross-series classification, average aggregation, user-specified cross-series groupby feature

	**Tags:**

	* Target-derived
	* Binary
	* Cross series

	**Example(s):**

	```
	is_zero_sales (region fraction equal 1) (3rd lag)
	is_zero_sales (region fraction equal 1) (3rd lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<groupby> weighted fraction equal <label>)`</span>

	**Description:** Weighted average target-equals-`<label>`(also called fraction) boolean flag, for a given time, across all series within the same group.

	**Project type:** Cross-series binary, average aggregation, user-specified cross-series groupby feature and weights

	**Tags:**

	* Target-derived
	* Binary
	* Cross series
	* Weighted

	**Example(s):**

	```
	is_zero_sales (region weighted fraction equal 1) (3rd lag)
	is_zero_sales (region weighted fraction equal 1) (3rd lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (is zero)`</span>

	**Description:** Boolean flag that indicates whether the target equals zero (used by zero-inflated tree-based models).

	**Project type:** Regression, minimum target equals zero

	**Tags:**

	* Target-derived
	* Numeric
	* Zero-inflated

	**Example(s):**

	```
	sales (is zero) (1st lag)
	sales (is zero) (7 day fraction equal 1)
	sales (is zero) (naive binary) (35 day fraction equal 1)
	sales (is zero) (1st lag) (diff 35 day mean)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (nonzero)`</span>

	**Description:** Replaces zero target value with missing value (used by zero-inflated tree-based models).

	**Project type:** Regression, minimum target equals zero

	**Tags:**

	* Target-derived
	* Numeric
	* Zero-inflated

	**Example(s):**

	```
	sales (nonzero) (log) (1st lag) (diff 35 day mean)
	sales (nonzero) (7 day max) (log) (diff 35 day mean)
	sales (nonzero) (35 day average baseline) (log)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<time_unit> aggregation)`</span>

	**Description:** Aggregates target data to a higher time unit (used by temporal hierarchical models).

	**Project type:** Regression

	**Tags:**

	* Target-derived
	* Numeric

	**Example(s):**

	`sales (week aggregation) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<target> (weighted <time_unit> aggregation)`</span>

	**Description:** Weighted target data, aggregated to a higher time unit (used by temporal hierarchical models).

	**Project type:** Regression, user-specified weights

	**Tags:**

	* Target-derived
	* Numeric

	**Example(s):**

	`sales (weighted week aggregation) (actual)`

=== "`<primary_date>`"

	The sections below list each name pattern for the primary date/time feature.

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (previous calendar event type)`</span>

	**Description:** Value of the previous calendar event. For example, if the calendar file has two events&mdash;Christmas and New Year&mdash;all observations between December 25 and January 1 will have previous calendar event type equal to “Christmas.” All observations between January 1 and December 25 will have feature equal to “New Year.” If there is no previous value, the feature will be null.

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	`date (previous calendar event type) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (next calendar event type)`</span>

	**Description:** Value of the next calendar event. For example, if the calendar file has two events&mdash;Christmas and New Year&mdash;all observations between December 25 and January 1 will have the next calendar event type equal to “New Year.” All observations between January 1 and December 25 will have feature equal to “Christmas”.

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	`date (previous calendar event type) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (calendar event type <N> day(s) before)`</span>

	**Description:** Feature that specifies a calendar event _N_ days before the date of the observation. For example, if the observation date is December 27, the feature `date (calendar event type 2 days before) (actual)` will be equal to "Christmas." Feature `date (calendar event type 1 days before) (actual)` will be null.

	If event types are not provided in the calendar file, this feature will take (1) or (0) values, specifying whether there is a calendar event _N_ days before.

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	```
	date (calendar event type 1 day before) (actual)
	date (calendar event type 2 days before) (actual)
	```

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (calendar event type <N> day(s) after)`</span>

	**Description:** Feature that specifies a calendar event _N_ days after the date of the observation. For example, if the observation date is December 23, feature `date (calendar event type 2 days after) (actual)` will be equal to "Christmas."  Feature `date (calendar event type 3 days after) (actual)` will be null.

	If event types are not provided in the calendar file, this feature will take (1) or (0) values specifying whether there is a calendar event _N_ days after.

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	`date (days from previous calendar event) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (<time_unit>(s) from previous calendar event)`</span>

	**Description:** Numeric feature that specifies the number of time units since a previously known calendar event. Time units depend on the dataset time step (e.g., for daily datasets, time units are in days). For example, if the observation date is December 28, this feature will be equal to 3 (in days).

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	```
	date (calendar event type 1 day after) (actual)
	date (calendar event type 2 days after) (actual)
	```

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (<time_unit>(s) to next calendar event)`</span>

	**Description:** Numeric feature that specifies the number of time units until the next known calendar event. Time units depend on the dataset time step (e.g., for daily datasets, time units are in days). For example, if the observation date is December 30, this feature will be equal to 5 (in days).

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	```
	date (calendar event type 1 day after) (actual)
	date (calendar event type 2 days after) (actual)
	```

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (calendar event type)`</span>

	**Description:** Specifies calendar events happening on the same date as the observation. For example, for observation an on December 25, the feature will be equal to “Christmas.” For December 26, the feature will be null.

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	`date (calendar event type) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<primary_date> (calendar event)`</span>

	**Description:** Specifies whether there is a calendar event on the date. Values are (1) if there is a calendar event on the same date as observation, otherwise (0).

	**Project type:** Uploaded event calendar

	**Tags:**

	* Date
	* Calendar

	**Example(s):**

	`date (calendar event) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<primary_date>  (hour of week)`</span>

	**Description:** Equals (day of week * 24 + hour) of the primary date. Result enumerates hours from beginning of the week to the end of the same week.

	**Project type:** Detected weekly seasonality, 24-hour seasonality

	**Tags:**

	* Date

	**Example(s):**

	`date (hour of Week) (actual)`

	---

	<span style="color:red;font-size: 1rem"> `<primary_date>  (common event)`</span>

	**Description:** Specifies whether the primary date is expected to be there or not. For example, for a Monday-to-Friday dataset, all the samples with primary date within (inclusive) Monday to Friday are true. Samples with weekend primary date will have the value of false.

	**Project type:** Regular missing of sample on certain day-of-week or hour-of-day (e.g., Monday to Friday dataset)

	**Tags:**

	* Date

	**Example(s):**

	`date (common event) (actual)`

=== "`<date>`"

	The sections below list each name pattern for date&mdash;non primary date/time&mdash;features.

	---

	<span style="color:red;font-size: 1rem"> `<date>  (<time_unit>s from <primary_date>)`</span>

	**Description:** Numeric feature that specifies the number of time units from the input date feature to the primary date/time. Output of this preprocessor is a numeric feature. Input is a date feature.

	**Project type:** Any, with minimum one non-low-info and non-primary date/time feature (at least one feature that fulfills both conditions).

	**Tags:**

	* Date

	**Example(s):**

	```
	due_date (days from date) (1st lag)
	due_date (days from date) (7 day mean)
	```

=== "`<text>`"

	The section below lists each name pattern for text features.

	---

	<span style="color:red;font-size: 1rem"> `<text> Length`</span>

	**Description:** Numeric feature that specifies the number of characters in a text column. Output of this preprocessor is a numeric feature. Input is a text feature.

	**Project type:** Numeric, minimum one non-low-info text input

	**Tags:**

	* Text

	**Example(s):**

	```
	(description Length) (1st lag)
	(description Length) (7 day mean)
	```

##  Final features {: #final-features }

The sections below detail the final features created using target-only, feature/target/intermediate, primary date, and date features during the feature engineering process.

=== "`<target>`, `<feature>`, and `<intermediate>`"

	The sections below list each name pattern for features that can be either a target, a non-target feature, or an intermediate feature.

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (actual)`</span>

	**Description:** Simple passthrough feature that, for a specific date, has the same value as in the raw dataset. These features are considered to be known in advance and can be copied as-is from the raw to the derived dataset. For non-target features, it is used when the feature is available at prediction time. Examples are date, date-derived, calendar, or user specified known-in-advance (a priori) features. For the target or derived target column, it is used as the target to fit the model.

	**Tags:**

	* Known-in-advance
	* Calendar
	* Date-derived
	* Target
	* Target-derived

	**Example(s):**

	```
	sales (actual)
	date (actual)
	date (Month of Year) (actual)
	date (calendar event) (actual)
	sales (actual)
	sales (week aggregation) (actual)
	```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (<N> lag)`</span>

	**Description:** Feature extracts the _N_ th most recent value in the feature derivation window. The minimum number of lags for any project is 1. For projects with a zero forecast distance (FDW=[-n, 0] and FW=[0]), the last value in the feature derivation window is the value at the forecast point and so the first lag is equivalent to the actual value known at the forecast point.

	**Tags:**

	* Lag

	**Example(s):**

		```
		sales (2nd lag)
		sales (region average) (1st lag)
		sales (region total) (4th lag)
		sales (diff 7 day) (2nd lag)
		```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (<window> <time_unit> <categorical_method>)`</span>

	**Description:** Feature extracts categorical statistics within the most recent `<window> <time_unit>` of the feature derivation window. The categorical statistics include "most_frequent" (returns item with the highest frequency), "n_unique" (returns number of unique values) and "entropy" (measure of uncertainty).

	**Tags:**

	* Category

	**Example(s):**

	```
	product_type (7 day most_frequent)
	product_type (7 day n_unique)
	product_type (7 day entropy)
	```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (same <matching_period>) (<window> <time_unit> <categorical_method>)`</span>

	**Description:** Feature extracts the categorical statistics of the same period within the most recent `<window> <time_unit>` of the feature derivation window. The categorical statistics include "most_frequent" (returns item with the highest frequency), "n_unique" (returns number of unique values) and "entropy" (measure of uncertainty). For example, the feature `product_type (same weekday) (35 day entropy)` computes `product_type` entropy of weekdays equal to forecast point over the last 5 weeks.

	**Tags:**

	* Category

	**Example(s):**

	```
	product_type (same weekday) (35 day most_frequent)
	product_type (same weekday) (35 day n_unique)
	product_type (same weekday) (35 day entropy)
	```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (<window> <time_unit> <fraction>)`</span>

	**Name patterns:**

	`<feature_or_target_or_intermediate> (<window> <time_unit> fraction empty)`

	`<feature_or_target_or_intermediate> (<window> <time_unit> fraction equal <label>)`

	**Description:** Feature computes the fraction of `<feature> equals <label>`. If `<label>` is an empty string, `<feature> equals <label>` becomes `fraction empty` within the most recent `<window> <time_unit>` of the feature derivation window. For example, `is_raining (7 day fraction empty)` computes the fraction of the `is_raining` feature equal to an empty string over the last 7 days.

	**Tags:**

	* Binary

	**Example(s):**

	```
	is_holiday (35 day fraction equal True)
	is_raining (7 day fraction equal empty)
	```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (same <matching_period>) (<window> <time_unit> <fraction>)`</span>

	**Name patterns:**

	`<feature_or_target_or_intermediate> (same <matching_period>) (<window> <time_unit> fraction empty)`

	`<feature_or_target_or_intermediate> (same <matching_period>) (<window> <time_unit> fraction equal <label>)`

	**Description:** Feature computes the fraction of `<feature> equals <label>`. If `<label>` is an empty string, `<feature> equals <label>` becomes `fraction empty` of the same period within the most recent `<window> <time_unit>` of the feature derivation window. For example, `is_raining (same weekday) (35 day fraction equal True)` computes the fraction of the `is_raining` feature equal to true over the last 35 days.

	**Tags:**

	* Binary

	**Example(s):**

	```
	is_raining (same weekday) (35 day fraction equal True)
	is_holiday (same weekday) (35 day fraction equal empty)
	```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (<window> <time_unit> <method>)`</span>

	**Description:** Feature computes the numerical statistic `<method>` within the most recent `<window> <time_unit>` of the feature derivation window. The numeric statistics include "max," "min," "mean," "median," "std," and "robust zscore."

	**Tags:**

	* Numeric

	**Example(s):**

	```
	sales (7 day max)
	sales (7 day min)
	sales (7 day mean)
	sales (7 day median)
	sales (7 day std)
	```

	---

	<span style="color:red;font-size: 1rem"> `<feature_or_target_or_intermediate> (same <matching_period>) (<window> <time_unit> <method>)`</span>

	**Description:** Feature computes the numerical statistic `<method>` of the same period within the most recent `<window> <time_unit>` of the feature derivation window. For example, the feature `sales (same weekday) (35 day mean)` computes the mean value of `sales` on the same weekday over the last 35 days.

	**Tags:**

	* Numeric

	**Example(s):**

	```
	sales (same weekday) (35 day max)
	sales (same weekday) (35 day min)
	sales (same weekday) (35 day mean)
	sales (same weekday) (35 day median)
	```

=== "`<target>`-only"

	The sections below list each name pattern for target-only features.

	---

	<span style="color:red;font-size: 1rem"> `<target> (naive or match) <strategy>`</span>

	**Name patterns:**

	`<target> (naive latest value)`

	`<target> (naive <period> seasonal value)`

	`<target> (naive 1 month seasonal value)`

	`<target> (match end of month) (naive 1 month seasonal value)`

	`<target> (match weekday from start of month) (naive 1 month seasonal value)`

	`<target> (match weekday from end of month) (naive 1 month seasonal value)`

	**Description:** Feature selects value from history to forecast the future based on different strategies. Naive latest prediction uses the latest history value to forecast the rows in the forecast window. Naive seasonal prediction extracts the previous season's target value in the history to forecast.</br>
	For example, for a given Monday-Friday dataset, naive latest prediction on Monday uses the target value of last Friday as the forecast for Monday. For the naive 7-day prediction, it uses the target value of last Monday. If a multiplicative trend is detected on the dataset, the naive prediction is in log scale.

	**Tags:**

	* Numeric
	* Naive/baseline

	**Example(s):**

	```
	sales (naive latest value)
	sales (naive 7 day seasonal value)
	sales (naive 1 month seasonal value)
	sales (match end of month) (naive 1 month seasonal value)
	sales (match weekday from start of month) (naive 1 month seasonal value)
	sales (match weekday from end of month) (naive 1 month seasonal value)
	sales (log) (naive latest value)
	sales (log) (naive 7 day seasonal value)
	sales (log) (naive 1 month seasonale value)
	sales (log) (match end of month) (naive 1 month seasonal value)
	sales (log) (match weekday from start of month) (naive 1 month seasonal value)
	sales (log) (match weekday from end of month) (naive 1 month seasonal value)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (last month <strategy>)`</span>

	**Name patterns:**

	`<target> (last month average baseline)`

	`<target> (last month weekly average)`

	`<target> (match end of month) (last month weekly average)`

	**Description:** Feature computes the previous month average target value, or previous month weekly average target value, with respect to the forecast point.

	For example, `sales (last month average baseline)` computes the average target value in the previous month, `sale (last month weekly average)` computes the weekly average target value of the same week in the previous month, `sales (match end of month) (last month weekly average)` computes the weekly average target value of the same week (aligned to the end of month) in the previous month. If multiplicative is detected in the dataset, log transform is applied after average value is computed.

	**Tags:**

	* Numeric
	* Naive/baseline

	**Example(s):**

	```
	sales (last month average baseline)
	sales (last month weekly average)
	sales (match end of month) (last month weekly average)
	sales (last month average baseline) (log)
	sales (last month weekly average) (log)
	sales (match end of month) (last month weekly average) (log)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (last month <fraction_strategy>)`</span>

	**Name patterns:**

	`<target> (last month fraction empty)`

	`<target> (match end of month) (last month weekly fraction empty)`

	`<target> (last month fraction equal <label>)`

	`<target> (match end of month) (last month weekly fraction equal <label>)`

	**Description:**

	Feature computes the fraction of the boolean flag that compares whether target equals <label>. `fraction empty` is used when the label is empty. All rows that fall within the previous month are used to compute the fraction.

	**Tags:**

	* Binary

	**Example(s):**

	```
	sales (last month fraction empty)
	sales (match end of month) (last month weekly fraction empty)
	sales (last month fraction equal True)
	sales (match end of month) (last month weekly fraction equal True)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (last month weekly <fraction>)`</span>

	**Name patterns:**

	`<target> (last month weekly fraction empty)`

	`<target> (last month weekly fraction equal <label>)`

	**Description:** Feature computes the fraction of the boolean flag that compares whether target equals <label>. `"fraction empty"` is used when the label is empty. All rows that fall within the same week of the previous month are used to compute the fraction.

	**Tags:**

	* Binary

	**Example(s):**

	```
	sales (last month weekly fraction empty)
	sales (last month weekly fraction equal True)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (naive binary) (match_and_fraction )`</span>

	**Name patterns:**

	`<target> (naive binary) (last month fraction empty)`

	`<target> (naive binary) (last month weekly fraction empty)`

	`<target> (naive binary) (match end of month) (last month weekly fraction empty)`

	`<target> (naive binary) (last month fraction equal <label>)`

	`<target> (naive binary) (last month weekly fraction equal <label>)`

	`<target> (naive binary) (match end of month) (last month weekly fraction equal <label>)`

	**Description:** Feature has the same value as the one without "naive binary" (for example, `<target> (naive binary) (last month fraction empty)` has the same value as `<target> (last month fraction empty)`). The distinction is that it can be used for naive binary predictions.

	**Tags:**

	* Binary
	* Naive/baseline

	**Example(s):**

	```
	is_raining (naive binary) (last month fraction empty)
	is_raining (naive binary) (last month weekly fraction empty)
	is_raining (naive binary) (match end of month) (last month weekly fraction empty)
	is_raining (naive binary) (last month fraction equal True)
	is_raining (naive binary) (last month weekly fraction equal True)<
	is_raining (naive binary) (match end of month) (last month weekly fraction equal True)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (naive binary) (<window> <time_unit> <fraction>`</span>

	**Name patterns:**

	`<target> (naive binary) (<window> <time_unit> fraction empty)`

	`<target> (naive binary) (<window> <time_unit> fraction equal <label>)`

	**Description:** Feature has the same value as a feature without "naive binary" (for example, `<target> (naive binary) (<window> <time_unit> fraction empty)` has the same value as `<target> (<window> <time_unit> fraction empty)`). The distinction is that it can be used for naive binary predictions.

	**Tags:**

	* Binary
	* Naive/baseline

	**Example(s):**

	```
	is_raining (naive binary) (35 day fraction equal True)
	is_raining (naive binary) (35 day fraction equal empty)
	```

	---

	<span style="color:red;font-size: 1rem"> `<target> (<window> <time_unit> mean baseline)`</span>

	**Description:** Feature is the same as `<target> (<window> <time_unit> mean)`. The distinction is that it can be used for naive predictions.

	**Tags:**

	* Numeric

	**Example(s):**

	`sales (7 day mean baseline)`

	---

	<span style="color:red;font-size: 1rem"> `<target> (last month weekly average baseline)`</span>

	**Description:** Feature computes the average between <code>`<target> (last month weekly average)``</span> and <code>`<target> (match end of the month) (last month weekly average)``</span>.</br>
	For example, `sales (last month weekly average)` is the average of `sales (last month weekly average)` (which is the average of sales on last month/same week) and `sales (match end of the month) (last month weekly average)` (which is the average of sales on last month/same week, week count starts from end of the month).

	**Tags:**

	* Numeric

	**Example(s):**

	`sales (last month weekly average baseline)`

=== "`<primary_date>`"


	<span style="color:red;font-size: 1rem"> `<primary_date> (<naive_boolean>)`</span>

	**Name patterns:**

	`<primary_date> (No History Available)`

	`<primary_date> (naive <period> prediction is missing)`

	`<primary_date> (naive 1 month prediction is missing)`

	`<primary_date> (match end of month) (naive 1 month prediction is missing)`

	`<primary_date> (match weekday from start of month) (naive 1 month prediction is missing)`

	`<primary_date> (match weekday from end of month) (naive 1 month prediction is missing)`

	**Description:** Boolean flag feature that specifies whether its corresponding naive prediction is missing. For example, a 7-day naive prediction on _this_ Friday is missing if the shop was closed _last_ Friday. In this case, the boolean feature value is true on this Friday. Each of these boolean features is related to different naive predictions. `<primary_date> (No History Available)` is related to naive latest predictions whereas the rest of the boolean features are related to different types of naive seasonal predictions.

	**Tags:**

	* Numeric
	* Multiseries

	**Example(s):**

	```
	date (No History Available)
	date (naive 7 day prediction is missing)
	date (naive 1 month prediction is missing)
	date (match end of month) (naive 1 month prediction is missing)
	date (match weekday from start of month) (naive 1 month prediction is missing)
	date (match weekday from end of month) (naive 1 month prediction is missing)
	```

=== "`<target-derived>`"


	<span style="color:red;font-size: 1rem"> `<target_derived> (diff <strategy>)`</span>

	**Name patterns:**

	`<target_derived> (diff <window> <time_unit> mean)`

	`<target_derived> (diff last month weekly mean)`

	`<target_derived> (diff last month mean)`

	**Description:** Feature computes the difference between the target-derived and baseline features.</br>
	For example:</br> &bull; `sales (1st lag) (diff 7 day mean)` is the difference between `sales (1st lag)` and `sales (7 day mean baseline)`</br> &bull; `sales (35 day max) (diff last month weekly mean)` is the difference between `sales (35 day meax)` and `sales (last month weekly average baseline)` </br> &bull; `sales (7 day mean) (diff last month mean)` is the difference between `sales (7 day mean)` and `sales (last month average baseline)`.

	**Tags:**

	* Numeric

	**Example(s):**

	```
	sales (1st lag) (diff 7 day mean)
	sales (35 day max) (diff last month weekly mean)
	sales (7 day mean) (diff last month mean)
	```

=== "`<date>`"

	<span style="color:red;font-size: 1rem"> `<date> (<time_unit>s between 1st forecast distance and last observable row)`</span>

	**Description:** Feature computes the time delta (in terms of integer number of time units) between the date/time of the first forecast distance and the date/time of the last row in the feature derivation window.

	**Tags:**

	* Numeric
	* Row-based

	**Example(s):**

	`date (days between 1st forecast distance and last observable row)`
